import request from '@/utils/request'

export default {

  // 按条件查询讲师
  getAllTeachers(eduTeacherQuery) {
    return request({
      url: '/eduTeacher/list',
      method: 'post',
      data: {
        "current": eduTeacherQuery.current,
        "limit": eduTeacherQuery.limit,
        "name": eduTeacherQuery.name,
        "level": eduTeacherQuery.level,
        "begin": eduTeacherQuery.begin,
        "end": eduTeacherQuery.end
      }
    });
  },

  // 逻辑删除讲师
  deleteTeacherById(id) {
    return request({
      url: `/eduTeacher/${id}`,
      method: 'delete'
    });
  },

  // 新增讲师
  addTeacher(teacher) {
    return request({
      url: '/eduTeacher/insert',
      method: 'post',
      data: teacher
    });
  },

  // 根据讲师id获取讲师信息
  getTeacherById(id) {
    return request({
      url: `/eduTeacher/${id}`,
      method: 'get'
    });
  },

  // 修改讲师信息
  updateTeacher(teacher) {
    return request({
      url: '/eduTeacher/update',
      method: 'post',
      data: teacher
    });
  },
  
  // 为下拉框查询教师信息
  selectTeacherForSelect() {
    return request({
      url: '/eduTeacher/list',
      method: 'get'
    });
  }

}
